
%% Selecting a random orientation in 3D

N=10000;

phi=2*pi*rand(N,1);

%the following comes from the inversion method:
web('http://en.wikipedia.org/wiki/Inverse_transform_sampling')

theta=acos(1-2*rand(N,1))

%convert to euclidean 
X=sin(theta).*cos(phi)
Y=sin(theta).*sin(phi)
Z=cos(theta)

figure
plot3(X,Y,Z,'.')
xlabel('X')
ylabel('Y')
zlabel('Z')
axis equal

%% Class Inheritance

%First make a class with some functionality

%See 'TestClassA.m'

%Make an object of the class and notice its properties and methods
A=TestClassA
A.A
A.a_square()

%Lets make a new class that does everything in 'TestClassA' plus 
%some extra stuff. 

%See 'TestClassAB.m'
AB=TestClassAB

%We can now use properties and methods TestClassA and our new stuff
AB.ab_sum()
AB.a_square()

%We can inherit from multiple classes simultaneously

%See 'TestClassACB.m'
ACB=TestClassACB

%Notice the properties and methods









